local thb_card_mingpai = fk.CreateSkill {

  name = "thb_card_mingpai",

  tags = { Skill.Compulsory, },

}



thb_card_mingpai:addEffect(fk.BeforeCardsMove, {
  name = "thb_card_mingpai",
  mute = true,
  global = true,
  can_trigger = function(self, event, target, player, data)
    for _, move in ipairs(data) do
      if move.from == player then
        for _, info in ipairs(move.moveInfo) do
          if info.fromArea == Card.PlayerHand and Fk:getCardById(info.cardId):getMark("@@thb_mingpai") > 0 then
            return true
          end
        end
      end
    end
  end,
  on_use = function(self, event, target, player, data)
    for _, move in ipairs(data) do
      if move.from == player then
        for _, info in ipairs(move.moveInfo) do
          if info.fromArea == Card.PlayerHand and Fk:getCardById(info.cardId):getMark("@@thb_mingpai") > 0 then
            player.room:removeCardMark(Fk:getCardById(info.cardId), "@@thb_mingpai",
              Fk:getCardById(info.cardId):getMark("@@thb_mingpai"))
          end
        end
      end
    end
  end
})

return thb_card_mingpai